home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / AIncludes / SonyEqu.a < prev    next >
Encoding:
Text File  |  1993-11-30  |  22.5 KB  |  598 lines  |  [TEXT/MPS ]

  1. ;    File:        SonyEqu.a
  2. ;
  3. ;    Copyright:    © 1983-1993 by Apple Computer, Inc.
  4. ;                All rights reserved.
  5. ;
  6. ;    Version:    System 7.1 for ETO #11
  7. ;    Created:    Tuesday, March 30, 1993 18:00
  8. ;
  9. ;___________________________________________________________________________
  10.  
  11.     IF &TYPE('__INCLUDINGSONYEQU__') = 'UNDEFINED' THEN
  12. __INCLUDINGSONYEQU__    SET    1
  13.  
  14. ; If SonyNonPortable is defined to be non-zero, Then a machine type must be specified!
  15.  
  16.                   IF          (&TYPE('SonyNonPortable') = 'UNDEFINED') THEN
  17. SonyNonPortable   EQU         0
  18.                   ENDIF
  19.  
  20.                   IF          (&TYPE('onMac') = 'UNDEFINED') THEN 
  21. onMac             EQU         1
  22.                   ENDIF
  23.  
  24.                   IF          (&TYPE('onMacPP') = 'UNDEFINED') THEN
  25. onMacPP           EQU         0
  26.                   ENDIF
  27.  
  28.                   IF          (&TYPE('onNuMac') = 'UNDEFINED') THEN
  29. onNuMac           EQU         0
  30.                   ENDIF
  31.  
  32.                   IF          (&TYPE('onHcMac') = 'UNDEFINED') THEN
  33. onHcMac           EQU         0
  34.                   ENDIF
  35.  
  36.                   IF          (&TYPE('forDiskDup') = 'UNDEFINED') THEN
  37. forDiskDup        EQU         0
  38.                   ENDIF
  39.  
  40. ; Note: supportsDCD means support for pass-thru connector as well.
  41. ; If this is 1, firstDCD and maxDCDcnt equates are needed as well.
  42. ; GetDrive must be adjusted for number of drives, as well!
  43.  
  44.                   IF          onMac THEN
  45. supportsPWM       EQU         1                         ; set to 1 if PWM supported
  46. maxDrvNum         EQU         4
  47. supportsDCD       EQU         1                         ; set to 1 to include DCD code
  48. firstDCD          EQU         3
  49. maxDCDcnt         EQU         2
  50. iwmMode           EQU         $1F
  51.                   ENDIF
  52.  
  53.                   IF          onMacPP THEN
  54. supportsPWM       EQU         1                         ; set to 1 if PWM supported
  55. maxDrvNum         EQU         5
  56. supportsDCD       EQU         1                         ; set to 1 to include DCD code
  57. firstDCD          EQU         4
  58. maxDCDcnt         EQU         2
  59. iwmMode           EQU         $17                       ; changed for Brian Howard to set half speed
  60. ; <?? same as Mac ??>
  61.                   ENDIF
  62.  
  63.                   IF          (&TYPE('onNuMacDCD') = 'UNDEFINED') THEN
  64. onNuMacDCD        EQU         0
  65.                   ENDIF
  66.  
  67.                   IF          onNuMac THEN
  68. supportsPWM       EQU         0                         ; set to 1 if PWM supported
  69.                   IF          onNuMacDCD THEN
  70. maxDrvNum         EQU         4
  71. supportsDCD       EQU         1                         ; set to 1 to include DCD code
  72. firstDCD          EQU         3
  73. maxDCDcnt         EQU         2
  74.                   ELSE
  75. maxDrvNum         EQU         2
  76. supportsDCD       EQU         0                         ; set to 1 to include DCD code
  77.                   ENDIF
  78. iwmMode           EQU         $17
  79.                   ENDIF
  80.  
  81.                   IF          onHcMac THEN
  82. supportsPWM       EQU         0                         ; set to 1 if PWM supported
  83. maxDrvNum         EQU         5
  84. supportsDCD       EQU         1                         ; set to 1 to include DCD code
  85. firstDCD          EQU         4
  86. maxDCDcnt         EQU         2
  87. iwmMode           EQU         $17
  88.                   ENDIF
  89.  
  90.  
  91.                   IF          SonyNonPortable THEN
  92.  
  93.                   IF          (&TYPE('supportsMFM') = 'UNDEFINED') THEN
  94. supportsMFM       EQU         0
  95.                   ENDIF
  96.  
  97. ; SonyVars Data Structure (offsets):
  98. ; (1) Driver local vars.
  99. ; (2) Drive-specific vars.
  100. ; (3) More driver local vars.
  101. ; (4) Direct-connect driver locals.
  102. ;
  103. ; Drive Constants:
  104. ; (1) Floppy drive constants (tuneable).
  105. ; (2) Floppy drive sense/control constants.
  106. ; (3) Floppy drive formatting constants.
  107. ; (4) Direct-connect drive constants.
  108. ;
  109. ; Driver Constants:
  110. ; (1) Driver Control codes.
  111. ;
  112. ; Driver Vectors:
  113. ; (1) Location of disk routine vectors.
  114. ;
  115. ;_______________________________________________________________________
  116.  
  117. ;_______________________________________;
  118. ; ;
  119. ; SonyVars Data Structure (offsets): ;
  120. ;_______________________________________;
  121.  
  122. ;_______________________________________;
  123. ;
  124. ; (1) Driver local vars. ; * = known to be used in a copy-
  125. ; protection scheme.
  126. ; +---------------------+ DiskUnitPtr <-----+
  127. ; | | |
  128. ; | "driver local vars" | |
  129. ; | | EjectWait |
  130. ; +---------------------+ <----+ |
  131. ; | | Track | |
  132. ; | drive1 | DrvLclLth |
  133. ; | | DriveMisc | |
  134. ; +---------------------+ <----+ |
  135. ; | | Track |
  136. ; | drive2 | Sony disk driver
  137. ; | | DriveMisc vars, plus
  138. ; +---------------------+ locals for each
  139. ; | | Track diskette drive
  140. ; | driveX | |
  141. ; | | DriveMisc |
  142. ; +---------------------+ |
  143. ; | | FloppyLclEnd |
  144. ; | "more driver vars" | |
  145. ; | | SonyVarEnd <-----+
  146. ; +---------------------+ <-----+
  147. ; | | Track |
  148. ; | driveN | |
  149. ; | | DriveMisc |
  150. ; +---------------------+
  151. ; | | DCD driver vars
  152. ; | driveN | plus locals for
  153. ; | | each DCD drive
  154. ; +---------------------+ |
  155. ; | | DCDCmd |
  156. ; | DCD driver locals | |
  157. ; | | DiskVarLth <-----+
  158. ; +---------------------+
  159. ;
  160. ;_______________________________________________________________________
  161. ;
  162.  
  163.                   IF          supportsMFM THEN
  164. mfmSectTime       EQU         75                        ;7.5msec sector time
  165. maxMFMSectors     EQU         18                        ;18 MFM sectors/track side (@1440K)
  166.                   ENDIF
  167.                 
  168. maxGCRSectors     EQU         12                        ;12 GCR sectors/track side (max)
  169. diskUnitPtr       EQU         0                         ; pointer to device control entry
  170. diskQVE           EQU         diskUnitPtr+4             ; disk VBL task control block
  171. drive             EQU         diskQVE+14                ; * 0001 = int drive, 0002 = ext drive
  172. wait              EQU         drive+2                   ; extra wait time for speed changes
  173. sideTrack         EQU         wait+2                    ; destination side/track
  174. oneToOne          EQU         sideTrack+2               ; open up rupts flg (no longer used)
  175. active            EQU         oneToOne+1                ; * non-zero when driver is active
  176. timeOut           EQU         active+1                  ; * power time out
  177. diskBuffer        EQU         timeOut+2                 ; pointer to track data buffer
  178. firstSect         EQU         diskBuffer+4              ; low sector number needed on a track
  179. sectMap           EQU         firstSect+2               ; bit map of sectors needed on a track
  180. firstFSeq         EQU         sectMap+4                 ; first file seq # for current r/w request
  181. fBlksDone         EQU         firstFSeq+2               ; file blocks done previous to this track
  182. readErrInit       EQU         fBlksDone+2               ; init value, read error countdown cntr
  183. readErrCnt        EQU         readErrInit+1             ; read error countdown cntr
  184. recalInit         EQU         readErrCnt+1              ; init value, recal count
  185. recalCnt          EQU         recalInit+1               ; recal count
  186. wrgSectInit       EQU         recalCnt+1                ; init value, wrong sector countdown cnt
  187. wrgSectCnt        EQU         wrgSectInit+1             ; wrong sector countdown cnt
  188. badSpdInit        EQU         wrgSectCnt+1              ; init value, bad speed
  189. badSpdCnt         EQU         badSpdInit+1              ; bad speed countdown value
  190. command           EQU         badSpdCnt+1               ; I/O command
  191. headSettle        EQU         command+2                 ; disk head settle time (@100usec)
  192. spdChgTime        EQU         headSettle+2              ; motor speed change time (@100usec)
  193. pwrOnTime         EQU         spdChgTime+2              ; * power-on wait time (@100usec)
  194. pwrOffTime        EQU         pwrOnTime+2               ; * power down time (@1/2sec)
  195. seekTime          EQU         pwrOffTime+2              ; seek wait time (@100usec)
  196. sectTime          EQU         seekTime+2                ; * sector time (@100usec)
  197. dskVBLTime        EQU         sectTime+2                ; VBL task time (@16ms)
  198. ejectTime         EQU         dskVBLTime+2              ; Eject time (@100usec)
  199. ckDelta           EQU         ejectTime+2               ; delta time before speed recheck
  200. ejectWait         EQU         ckDelta+4                 ; VBL times after eject to ignore DIP
  201.  
  202. ; Format/Verify code reuses some of these fields as follows:
  203.  
  204. gapSync           EQU         sectMap                   ; (2) start with 7 groups of intersector sync
  205. twoSided          EQU         command                   ; (1) set non-zero for 2-sided format
  206. sectSave          EQU         firstSect                 ; (2) SectMpSave must follow
  207. sectMapSave       EQU         sectMap                   ; (8) uses SectMap, FirstFSeq, FBlksDone
  208. sectCnt           EQU         firstSect                 ; (2) loop counter . . .
  209.  
  210. ;_______________________________________;
  211. ;
  212. ; (2) Drive-specific vars.
  213.  
  214. drvLclLth         EQU         66
  215. drive1            EQU         ejectWait+2               ; * internal drive variables
  216. drive2            EQU         drive1+drvLclLth          ; * external drive variables
  217.  
  218.                   IF          onMacPP | onHcMac THEN
  219. drive3            EQU         drive2+drvLclLth          ; * real external for MacPP
  220. floppyLclEnd      EQU         drive3+drvLclLth
  221.                   ELSEIF        onMac | onNuMac | onMac32 THEN
  222. floppyLclEnd      EQU         drive2+drvLclLth
  223.                   ENDIF
  224.  
  225. track             EQU         0                         ; current track location (used for spd)
  226. writeProt         EQU         2                         ; * bit7=1=write-protected
  227. diskInPlace       EQU         3                         ; * $FC-$FF= just ejected,
  228. ; 0=no disk in place,1=DIP,2=clamped
  229. installed         EQU         4                         ; * 0=don't know, 1=inst., $FF=not inst.
  230. sides             EQU         5                         ; * bit7=0=1 sided
  231. dqel              EQU         6                         ; drive queue element for this drive
  232. driveQLink        EQU         6
  233. driveQVers        EQU         10
  234. driveSize         EQU         18                        ; drive block size (DCD only!)
  235. twoSideFmt        EQU         18                        ; * non-zero if 2-sided format
  236. newIntf           EQU         19                        ; $FF if new interface, $00 for old 
  237. driveErrs         EQU         20                        ; drive soft errs
  238. driveS1           EQU         20                        ; drive block size (high word)
  239. driveType         EQU         22                        ; old OffSpeed (no longer supported)
  240. driveManf         EQU         24
  241. driveChar         EQU         26
  242.  
  243.                   IF          supportsMFM THEN
  244. mfmDrive          EQU         22                        ;$FF=SuperDrive, $00=400K or 800K GCR
  245. mfmDisk           EQU         23                        ;$FF=MFM, $00=GCR or unformatted
  246. twoMegFmt         EQU         24                        ;$FF=2 meg MFM (1440K), $00=1 meg (720K)
  247.                   ENDIF
  248.  
  249. driveMisc         EQU         27
  250. spdAdjCnt         EQU         24                        ; speed adjust count this drive
  251. trkSpeedTbl       EQU         26                        ; 5-entry track speed table
  252. tSTblCode         EQU         0                         ; first is speed code
  253. tSTblDelta        EQU         2                         ; 2% speed code delta
  254. tSTblTicks        EQU         4                         ; longword last time checked tick cnt
  255. trkSTEnd          EQU         66                        ; end of drive vars
  256.  
  257. ;_______________________________________;
  258. ;
  259. ; (3) More driver local vars.
  260.  
  261. wakeTimeCnt       EQU         floppyLclEnd              ; WakeUp remainder count
  262. saveRegs          EQU         wakeTimeCnt+2             ; * wakeup routine saves D3-D7,A3-A6 here
  263. tagBufPtr         EQU         saveRegs+36               ; if non-zero, pointer to separate
  264.                                                         ; buffer for file tags . . .
  265. tagBufOS          EQU         tagBufPtr+4               ; temp offset into buffer
  266. diskErrs          EQU         tagBufOS+2                ; global soft errors
  267. passThru          EQU         diskErrs+2                ; 0 if pass thru on external port
  268.                   IF          supportsMFM THEN
  269. hasSuperDrives    EQU         passThru+1                ; $FF if at least 1 SuperDrive connected
  270. curSector         EQU         hasSuperDrives+1          ; current sector being read/written 
  271.                   ELSE
  272. sonyExtra         EQU         passThru+1                ; extra byte
  273. curSector         EQU         sonyExtra+1               ; current sector being read/written 
  274.                   ENDIF
  275.  
  276. tcRdEnable        EQU         curSector+2               ; (byte) set non-zero to activate reads into cache
  277. tcInstalled       EQU         tcRdEnable+1              ; (byte) non-zero when caching is installed and on
  278. tcDrive           EQU         tcInstalled+1             ; (word) drive number of cache blks (zero to inval)
  279. tcSideTrack       EQU         tcDrive+2                 ; (word) side/track of cache blocks 
  280. tcSectMap         EQU         tcSideTrack+2             ; (long) bitmap of sectors currently cached 
  281. tcBuffer          EQU         tcSectMap+4               ; (long) pointer to track cache buffer (512+12)*12
  282. tcNumCached       EQU         tcBuffer+4                ; (word) number read into cache 
  283. tcNumUsed         EQU         tcNumCached+2             ; (word actual number used
  284. lastDrive         EQU         tcNumUsed+2               ; (word) set at CkDrvNum to previous value of Drive
  285. timeOutDrive      EQU         lastDrive+4               ; (word) set at PowerDown to value of Drive 
  286. ; Above value should have been +2 since lastDrive is a word.
  287. timeQEl           EQU         timeOutDrive+2            ; a time queue element
  288.  
  289.                   IF          onMac | (onMac32 and (NOT(onMacPP | onHcMac | forROM))) THEN
  290. nextGZProc        EQU         timeQEl+tmQSize-2         ; (long) saved old GZ proc
  291. ; Above had been +tmQSize, but that changed from $C to $E.
  292. sonyVarEnd        SET         nextGZProc+4              ; end of sony vars excluding DCD
  293.                   ELSE
  294. nextGZProc        EQU         timeQEl+tmQSize           ; (long) saved old GZ proc
  295. driveXlat         EQU         nextGZProc + 4            ; drive translate table (GetDrive,DiskOpen)
  296. drvTblPtr         EQU         driveXlat+((maxDrvNum+1)*2) 
  297.                                                         ; (long) pointer to DrvTbl to use
  298. sonyVarEnd        SET         drvTblPtr+4
  299.                   ENDIF
  300.  
  301.                   IF          supportsMFM THEN
  302. isSWIM            EQU         sonyVarEnd                ;FDC type: $FF=SWIM, $00=IWM
  303. mfmMode           EQU         isSWIM+1                  ;Current register set selected: $FF=SWIM, $00=IWM
  304. sonyVarEnd        SET         mfmMode+1                 ; end of sony vars excluding DCD
  305.                   ENDIF
  306.  
  307.                   IF          onHcMac THEN
  308. chipState         EQU         sonyVarEnd                ; Byte holds flag to indicate IWM on or off
  309. sonyVarEnd        SET         chipState+2               ; end of sony vars excluding DCD
  310.                   ENDIF
  311.  
  312.                   IF          hasPwrControls | hasPowerMgr THEN        ; <1.1>
  313. chipState         EQU         sonyVarEnd                ; Bit7 - saved VIA dir, 6..0 - pmgr enables <1.1>
  314. diskSleepQEL    EQU            chipState+2                ; sleep/wakeup queue element
  315. sonyVarEnd        SET         diskSleepQEL+SleepqRec.SleepqSize    ; end of sony vars excluding DCD
  316.                   ENDIF
  317.  
  318.                 IF            forDiskDup THEN
  319. fmtParams        EQU            sonyVarEnd                ;pointer to parameters for special format command
  320. gcrFmtByte        EQU            fmtParams+4                ; saved GCR format byte for duplicator
  321. sonyVarEnd        SET            gcrFmtByte+2
  322.                 ENDIF
  323.  
  324.  
  325.                   IF          onMac|onNuMacDCD THEN
  326. ;_______________________________________;
  327. ;
  328. ; (4) Direct-connect driver locals.
  329.  
  330. tagSize           EQU         20                        ; 20 bytes tags/block
  331. dcdLclLth         EQU         28                        ; (use fields through DriveMisc)
  332. drive3            EQU         sonyVarEnd                ; first DCD 
  333. drive4            EQU         drive3+dcdLclLth          ; second DCD
  334. drive5            EQU         drive4+dcdLclLth          ; third DCD
  335. drive6            EQU         drive5+dcdLclLth          ; fourth DCD
  336.  
  337.                   ENDIF
  338.  
  339.                   IF          onMacPP|onHcMac THEN
  340. ;_______________________________________;
  341. ;
  342. ; (4) Direct-connect driver locals.
  343.  
  344. tagSize           EQU         20                        ; 20 bytes tags/block
  345. dcdLclLth         EQU         28                        ; (use fields through DriveMisc)
  346. drive4            EQU         sonyVarEnd                ; first DCD
  347. drive5            EQU         drive4+dcdLclLth          ; second DCD
  348. drive6            EQU         drive5+dcdLclLth          ; third DCD
  349.                   ENDIF
  350.  
  351.                   IF          onMac|onMacPP|onHcMac|onNuMacDCD THEN
  352.  
  353.  
  354. stsRtnAddr        EQU         drive6+dcdLclLth          ; DCD status call return address
  355. dcdCmd            EQU         stsRtnAddr+4              ; command byte to DCD
  356. response          EQU         dcdCmd                    ; response byte (command+$80)
  357. seqNum            EQU         response+1                ; mb sequence number (sys commands only)
  358. status            EQU         seqNum+1                  ; returned status bytes
  359. startBlock        EQU         status                    ; starting block # (in commands)
  360. driveOut          EQU         startBlock+3              ; we send drive number in this field
  361. driveIn           EQU         status+2                  ; low 6 bits
  362. tagBytes          EQU         status+4                  ; tag bytes get stuffed here temporarily
  363. devType           EQU         tagBytes                  ; first 20 bytes of status are written
  364. devManufctr       EQU         devType+2                 ; in the 20-byte tag buffer
  365. devChar           EQU         devManufctr+2
  366. devBlks           EQU         devChar                   ; low 3 bytes of this longword
  367. devSpares         EQU         devChar+4
  368. devBadBlks        EQU         devSpares+2
  369. devMisc           EQU         devBadBlks+2              ; 8 bytes misc
  370. bufSize           EQU         tagBytes+tagSize          ; number of bytes/block
  371. lastStatus        EQU         bufSize+4                 ; last status returned
  372. lastResult        EQU         lastStatus+4              ; error type
  373. dcdFlags          EQU         lastResult+1              ; flag of whether we've done a reset
  374. chkTime           EQU         dcdFlags+1                ; 100usec check ready count
  375. maxTime           EQU         chkTime+2                 ; maximum number of checks
  376. stsBuffer         EQU         maxTime+2                 ; 512 bytes of status
  377. devReserve        EQU         stsBuffer
  378. devIcon           EQU         devReserve+44
  379. devFiller         EQU         devIcon+256               ; 32 bytes for optional name
  380. diskVarLth        EQU         devFiller+32
  381. stsBufSize        EQU         diskVarLth-stsBuffer
  382.  
  383.                   ELSE                                  ;
  384. diskVarLth        EQU         sonyVarEnd                ;
  385.                   ENDIF                                 ;
  386.  
  387. ; device characteristics byte:
  388.  
  389. devChEject        EQU         4                         ; ejectable if 1
  390. devChWP           EQU         3                         ; write protected if 1
  391. devChIcon         EQU         2                         ; icon available if 1
  392.  
  393.  
  394. ;_______________________________________;
  395. ; ;
  396. ; Drive Constants: ;
  397. ;_______________________________________;
  398.  
  399.  
  400. dqSides           EQU         -1                        ; Bit 7 of this byte: 0=single-sided Sony, 1=double sided
  401. dqInstall         EQU         -2                        ; 0=unknown, 1=installed, FF=no disk
  402. dqDIP             EQU         -3                        ; $FC-$FF = disk just ejected,
  403. ; 0 = no disk in place
  404. ; 1 = disk in place
  405. ; 2 = disk has been read
  406. ; >8 = non-ejectable disk
  407. dqWrPrt           EQU         -4                        ; Bit 7 of this byte: 1=disk is write protected.
  408.  
  409. ;_______________________________________;
  410. ;
  411. ; (1) Floppy drive constants (tuneable).
  412.  
  413. kSeekTime         EQU         120                       ; 12 ms trk-to-trk
  414. kHdSetTime        EQU         300                       ; 30 ms head settle time
  415. kEjectTime        EQU         7500                      ; .75 seconds eject time
  416. kEjectWait        EQU         -4                        ; - number of VBL calls after eject before dip check
  417. kSectTime         EQU         100                       ; minimum sector time in 100 us increments (10 ms)
  418. kPowerOn          EQU         4000                      ; read/write powerup time in 100 us increments
  419. kRWPOff           EQU         5                         ; read/write power off time (in 1/2 seconds)
  420. kDskVBLTime       EQU         30                        ; happens every 1/2 second
  421. kSpdChgTime       EQU         1500                      ; speed change wait time = 150ms
  422. kCkDelta          EQU         14400                     ; speed check delta time (in 1/60 sec) (4 min)
  423.  
  424. ;_______________________________________;
  425. ;
  426. ; (2) Floppy drive sense/control constants.
  427. ; (ca1-ca0-sel-ca2).
  428.  
  429. dirLAdr           EQU         0                         ; dirtn low
  430. dirHAdr           EQU         1
  431. rdDtaAdr          EQU         1                         ; side 0 read data
  432. rdDta1Adr         EQU         3                         ; side 1 read data
  433. stepLAdr          EQU         4                         ; step low and step sense address
  434. stepHAdr          EQU         5
  435.                   IF          supportsMFM THEN
  436. mfmModeAdr        EQU         6                         ;Switch drive into MFM (constant) mode
  437. gcrModeAdr        EQU         7                         ;Switch drive into GCR (variable) mode
  438.                   ENDIF
  439. mtrOnAdr          EQU         8
  440. mtrOffAdr         EQU         9
  441. ejectLAdr         EQU         12
  442. ejectHAdr         EQU         13
  443. dipAdr            EQU         2                         ; disk in place sense address
  444. mfmDrvAdr         EQU         5                         ;1=SuperDrive, 0=400K or 800K GCR
  445. wrProtAdr         EQU         6                         ; write protect sense address
  446. sidesAdr          EQU         9                         ; sense for number of sides
  447. tk0Adr            EQU         10                        ; track 0 sense address
  448. readyAdr          EQU         11                        ; /Ready sense address
  449. drvExstAdr        EQU         13                        ; sense=0 when a drive is connected
  450. tachAdr           EQU         14                        ; tach feedback sense address
  451. newIntfAdr        EQU         15                        ; implements ready handshake if 1
  452.                   IF          supportsMFM THEN
  453. twoMegAdr         EQU         15                        ;0=1 meg disk, 1=2 meg disk
  454.                   ENDIF
  455.  
  456. ;_______________________________________;
  457. ;
  458. ; (3) Floppy drive formatting constants.
  459.  
  460. fmtByte           EQU         $02                       ; 2-1 interleave, single-sided
  461. fmt2Byte          EQU         $22                       ; 2-1 interleave, double-sided
  462. mustFindCt        EQU         1500
  463. minSync           EQU         4                         ; min number of inter-sector sync groups
  464.                   IF          supportsMFM THEN
  465.  
  466. numSDFmts         EQU         3                         ; 2 GCR + 1 MFM single-density
  467. numDDFmts         EQU         1                         ; 1 MFM double-density format
  468.                   ELSE
  469. numSDFmts         EQU         2                         ; 2 GCR single density formats
  470.                   ENDIF
  471.  
  472.                   IF          onMac|onMacPP|onHcMac|onNuMacDCD THEN
  473. ;_______________________________________;
  474. ;
  475. ; (4) Direct-connect drive constants.
  476.  
  477. blkSize           EQU         512                       ; 512 bytes data/block
  478. syncByte          EQU         $AA                       ; Sync byte for start of transmission
  479. nonZerStat        EQU         1
  480. comErr            EQU         2
  481.  
  482. ; New HD20 error codes
  483.  
  484. wrtHsLw           EQU         $10                       ; HSHK low before starting
  485. wrtHSLwTO         EQU         $11                       ; Time out waiting for HSHK to go low
  486. wrtHSHighTO       EQU         $13                       ; Time out waiting for HSHK to go high
  487. rdHsHi            EQU         $20                       ; HSHK high before starting
  488. rdSyncTO          EQU         $21                       ; Time out waiting for sync ($AA) bye
  489. rdGroupTO         EQU         $22                       ; Time out waiting for group
  490. rdHoffSyncTO      EQU         $24                       ; Time out waiting for sync after holdoff
  491. rdHsHiTO          EQU         $25                       ; Time out waiting for HSHK high
  492. rdChksumErr       EQU         $26                       ; Checksum error on response packet
  493. invalidResp       EQU         $30                       ; First byte in response packet was wrong
  494. sqncNumErr        EQU         $31                       ; Sequence number in response packet was wrong
  495. dNumberErr        EQU         $32                       ; Drive number in response packet was wrong
  496. noResp            EQU         $40                       ; No response packet ever received
  497.  
  498. ; LastStatus
  499.  
  500. opFailed          EQU         24                        ; bit to test for operation failed
  501. bChksum           EQU         30                        ; bit number for checksum error
  502.  
  503. ; DCDFlags
  504.  
  505. resetonce         EQU         0
  506. retryonce         EQU         1
  507. maxTries          EQU         4                         ; max # times to try command
  508. tSeekChk          EQU         10                        ; check during a seek every 1 ms
  509. tSeekMax          EQU         10000                     ; max time for seek = 10 secs
  510. tStsChk           EQU         10                        ; check during a status every 1 ms
  511. tStsMax           EQU         10000                     ; max time for status = 10 secs
  512. tQuickTime        EQU         100
  513. tNextChk          EQU         7                         ; check for next block after 700 µsec
  514. tNextMax          EQU         10000                     ; max time for next block = 7 secs
  515. tFVChk            EQU         100                       ; check during fmt/vfy every 10 ms
  516. tFVMax            EQU         18000                     ; max time for fmt/vfy = 3 minutes
  517. tRstAssert        EQU         1000                      ; assert reset for 100 msec
  518. tRstSettle        EQU         20000                     ; 2 sec wait for busy to settle
  519. tRstChk           EQU         100                       ; check during reset every 10 ms
  520. tRstMax           EQU         1600                      ; max time for reset = 16 seconds
  521.  
  522. ; DCD sense/cntl addr (ca1-ca0-sel-ca2)
  523.  
  524. dcdExist          EQU         5                         ; /Exist (/Sides=/DrvIn=1 also)
  525. dcdReset          EQU         1                         ; for 1ms resets DCD controller
  526.                   ENDIF                                 ;
  527.  
  528. ;_______________________________________;
  529. ; ;
  530. ; Driver Constants: ;
  531. ;_______________________________________;
  532.  
  533. ;_______________________________________;
  534. ;
  535. ; (1) Driver Control codes.
  536.  
  537. verifyCC          EQU         5                         ; 'verify' control code
  538. formatCC          EQU         6                         ; 'format' control code
  539. tagBufCC          EQU         8                         ; 'set tag buffer' control code
  540. tCacheCC          EQU         9                         ; 'track cache' control 
  541. iconIDCC          EQU         20                        ; 'get icon id' control code
  542. iconCC            EQU         21                        ; 'get icon' control code
  543. iconLogCC         EQU         22                        ; 'get logical icon' code
  544. infoCC            EQU         23                        ; 'get drive info' code
  545.                   IF          forDiskDup THEN
  546. FmtCopyCC         EQU         $5343                     ;one-pass format/copy/verify for disk duplicator
  547.                   ENDIF
  548. GetRawDataCC    EQU            18244                    ; 'get raw track data' code                <1.5>
  549.  
  550. ; (2) Driver Status codes.
  551.  
  552. fmtLstCode        EQU         6                         ;Returns a list of disk formats
  553.                   IF          supportsMFM THEN
  554. mfmStsCode        EQU         10                        ;'Get MFM status' status code
  555.                   ENDIF
  556.                   IF          forDiskDup THEN
  557. DupVerSts         EQU         $4456                     ;disk duplicator version supported (to match features)
  558. FmtByteSts        EQU         $5343                     ;return address header format byte
  559.                   ENDIF                                 ; for disk duplicator
  560.  
  561.  
  562. ;_______________________________________;
  563. ;
  564. ; Driver Vectors: ;
  565. ;_______________________________________;
  566.  
  567. ;_______________________________________;
  568. ;
  569. ; (1) Location of disk routine vectors.
  570.  
  571. jFigTrkSpd        EQU         DiskVars
  572. jDiskPrime        EQU         jFigTrkSpd+4
  573. jRdAddr           EQU         jDiskPrime+4
  574. jRdData           EQU         jRdAddr+4
  575. jWrData           EQU         jRdData+4
  576. jSeek             EQU         jWrData+4
  577. jSetUpPoll        EQU         jSeek+4
  578. jRecal            EQU         jSetUpPoll+4
  579. jControl          EQU         jRecal+4
  580. jWakeUp           EQU         jControl+4
  581. jReSeek           EQU         jWakeUp+4
  582. jMakeSpdTbl       EQU         jReSeek+4
  583. jAdrDisk          EQU         jMakeSpdTbl+4
  584. jSetSpeed         EQU         jAdrDisk+4
  585. niblTbl           EQU         jSetSpeed+4
  586. jDiskSel          EQU         $B40                      ; (long) vector to .Sony DiskSelect routine 
  587. jSendCmd          EQU         $B44                      ; (long) vector to .Sony DCD SendCmd routine
  588. jDCDReset         EQU         $B48                      ; (long) vector to .Sony DCD DCDReset routine
  589.  
  590.                   IF          supportsMFM THEN
  591. jMRdAddr          EQU         $680                      ; (long) vector to MFM MRdAddr
  592. jMRdData          EQU         jMRdAddr+4                ; (long) vector to MFM MRdData
  593. jMWrData          EQU         jMRdData+4                ; (long) vector to MFM MWrData
  594.                   ENDIF
  595.  
  596.                   ENDIF                                 ;end exclusion of private information
  597.  
  598.     ENDIF    ; ...already included